package com.basic.codetool;

import com.basic.common.CommonCfg;
import com.basic.datapersist.dbadapter.MysqlDb;

class CoodToolDbConnect extends MysqlDb {

	private static CoodToolDbConnect connect = null;
	private CoodToolDbConnect (){
		
	}
	public static CoodToolDbConnect instance(){
		if(connect == null)
			connect = new CoodToolDbConnect();
		return connect;
	}
	@Override
	protected String getDbIpAndPort() {
		return CommonCfg.readValue(DbConnVarDefine.DB_MYSQL_IP);
	}

	@Override
	protected String getDbName() {
		return CommonCfg.readValue(DbConnVarDefine.DB_MYSQL_NAME);
	}

	@Override
	protected String getLoginName() {
		return CommonCfg.readValue(DbConnVarDefine.DB_MYSQL_USERNAME);
	}

	@Override
	protected String getPassword() {
		return CommonCfg.readValue(DbConnVarDefine.DB_MYSQL_PASSWORD);
	}

	@Override
	protected String getEncode() {
		return "utf-8";
	}
	@Override
	public boolean printSql() {
 		return CommonCfg.readBooleanValue(DbConnVarDefine.SHOW_SQL);
	}
}